<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});
//BLOG资源路由
Route::resource('blog','BlogController');
//AJAX路由
Route::post('blog/sh','ShowController@sh');

// 用户认证路由
Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', 'Auth\AuthController@postLogin');
Route::get('auth/logout', 'Auth\AuthController@getLogout');
// 用户注册路由...
Route::get('auth/register', 'Auth\AuthController@getRegister');
Route::post('auth/register', 'Auth\AuthController@postRegister');
//验证码路由
Route::get('auth/code/{tmp}', 'Auth\AuthController@code');
//图片上传
Route::resource('image','Home\ImageController');
//后台增删改查admin
Route::group(['namespace' => 'Admin','prefix' => 'admin'],function(){
	//后台网页路由
	Route::get('index','IndexController@index');

	//后台用户列表路由
	Route::get('del/{id}','DelController@del');
	Route::get('cat_del/{id}','DelController@cat_del');
	Route::resource('user','UserController');
	//后台版块路由
	Route::resource('cat','CatController');
	Route::get('cat_suc','CatController@suc');

});